﻿using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace DataEntities
{
    [Table(Name = "dbo.CarInfo")]
    public class CarInfo : Entity
    {
        private int _iCarid;

        private string _sCType;

        private string _sCPId;

        private string _sCJId;

        private string _sEngineId;

        private Binary _mCPhoto;

        private bool _bBF;

        private DateTime _tBFDate;

        private EntitySet<YuZuInfo> _YuZuInfo;

        private EntitySet<ChuZuInfo> _ChuZuInfo;

        private EntitySet<TuiHuanInfo> _TuiHuanInfo;

        private EntitySet<WeiZhangInfo> _WeiZhangInfo;

        public CarInfo()
        {
            _YuZuInfo = new EntitySet<YuZuInfo>(attach_YuZuInfo, detach_YuZuInfo);
            _ChuZuInfo = new EntitySet<ChuZuInfo>(attach_ChuZuInfo, detach_ChuZuInfo);
            _TuiHuanInfo = new EntitySet<TuiHuanInfo>(attach_TuiHuanInfo, detach_TuiHuanInfo);
            _WeiZhangInfo = new EntitySet<WeiZhangInfo>(attach_WeiZhangInfo, detach_WeiZhangInfo);
        }

        [Column(Storage = "_iCarid", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public int iCarid
        {
            get
            {
                return _iCarid;
            }
            set
            {
                if ((_iCarid != value))
                {
                    SendPropertyChanging("iCarid");
                    _iCarid = value;
                    SendPropertyChanged("iCarid", value);
                }
            }
        }

        [Column(Storage = "_sCType", DbType = "VarChar(30)")]
        public string sCType
        {
            get
            {
                return _sCType;
            }
            set
            {
                if ((_sCType != value))
                {
                    SendPropertyChanging("sCType");
                    _sCType = value;
                    SendPropertyChanged("sCType", value);
                }
            }
        }

        [Column(Storage = "_sCPId", DbType = "VarChar(15)")]
        public string sCPId
        {
            get
            {
                return _sCPId;
            }
            set
            {
                if ((_sCPId != value))
                {
                    SendPropertyChanging("sCPId");
                    _sCPId = value;
                    SendPropertyChanged("sCPId", value);
                }
            }
        }

        [Column(Storage = "_sCJId", DbType = "VarChar(30)")]
        public string sCJId
        {
            get
            {
                return _sCJId;
            }
            set
            {
                if ((_sCJId != value))
                {
                    SendPropertyChanging("sCJId");
                    _sCJId = value;
                    SendPropertyChanged("sCJId", value);
                }
            }
        }

        [Column(Storage = "_sEngineId", DbType = "VarChar(30)")]
        public string sEngineId
        {
            get
            {
                return _sEngineId;
            }
            set
            {
                if ((_sEngineId != value))
                {
                    SendPropertyChanging("sEngineId");
                    _sEngineId = value;
                    SendPropertyChanged("sEngineId", value);
                }
            }
        }

        [Column(Storage = "_mCPhoto", DbType = "Image", CanBeNull = true, UpdateCheck = UpdateCheck.Never)]
        public Binary mCPhoto
        {
            get
            {
                return _mCPhoto;
            }
            set
            {
                if ((_mCPhoto != value))
                {
                    SendPropertyChanging("mCPhoto");
                    _mCPhoto = value;
                    SendPropertyChanged("mCPhoto", value);
                }
            }
        }

        [Column(Storage = "_bBF", DbType = "Bit")]
        public bool bBF
        {
            get
            {
                return _bBF;
            }
            set
            {
                if ((_bBF != value))
                {
                    SendPropertyChanging("bBF");
                    _bBF = value;
                    SendPropertyChanged("bBF", value);
                }
            }
        }

        [Column(Storage = "_tBFDate", DbType = "DateTime")]
        public DateTime tBFDate
        {
            get
            {
                return _tBFDate;
            }
            set
            {
                if ((_tBFDate != value))
                {
                    SendPropertyChanging("tBFDate");
                    _tBFDate = value;
                    SendPropertyChanged("tBFDate", value);
                }
            }
        }

        [Association(Name = "CarInfo_YuZuInfo", Storage = "_YuZuInfo", ThisKey = "iCarid", OtherKey = "iCarid")]
        public EntitySet<YuZuInfo> YuZuInfo
        {
            get
            {
                return _YuZuInfo;
            }
            set
            {
                _YuZuInfo.Assign(value);
            }
        }

        [Association(Name = "CarInfo_ChuZuInfo", Storage = "_ChuZuInfo", ThisKey = "iCarid", OtherKey = "iCarid")]
        public EntitySet<ChuZuInfo> ChuZuInfo
        {
            get
            {
                return _ChuZuInfo;
            }
            set
            {
                _ChuZuInfo.Assign(value);
            }
        }

        [Association(Name = "CarInfo_TuiHuanInfo", Storage = "_TuiHuanInfo", ThisKey = "iCarid", OtherKey = "iCarid")]
        public EntitySet<TuiHuanInfo> TuiHuanInfo
        {
            get
            {
                return _TuiHuanInfo;
            }
            set
            {
                _TuiHuanInfo.Assign(value);
            }
        }

        [Association(Name = "CarInfo_WeiZhangInfo", Storage = "_WeiZhangInfo", ThisKey = "iCarid", OtherKey = "iCarid")]
        public EntitySet<WeiZhangInfo> WeiZhangInfo
        {
            get
            {
                return _WeiZhangInfo;
            }
            set
            {
                _WeiZhangInfo.Assign(value);
            }
        }

        private void attach_YuZuInfo(YuZuInfo entity)
        {
            entity.CarInfo = this;
        }

        private void detach_YuZuInfo(YuZuInfo entity)
        {
            entity.CarInfo = null;
        }

        private void attach_ChuZuInfo(ChuZuInfo entity)
        {
            entity.CarInfo = this;
        }

        private void detach_ChuZuInfo(ChuZuInfo entity)
        {
            entity.CarInfo = null;
        }

        private void attach_TuiHuanInfo(TuiHuanInfo entity)
        {
            entity.CarInfo = this;
        }

        private void detach_TuiHuanInfo(TuiHuanInfo entity)
        {
            entity.CarInfo = null;
        }

        private void attach_WeiZhangInfo(WeiZhangInfo entity)
        {
            entity.CarInfo = this;
        }

        private void detach_WeiZhangInfo(WeiZhangInfo entity)
        {
            entity.CarInfo = null;
        }
    }
}
